package com.tyl.arrray;
import java.util.Scanner;

public class tyl3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] arr=new int[6];
        for (int i = 0; i < 6; i++) {
            arr[i]= scanner.nextInt();
        }
        for (int i = 0; i < 6; i++) {
            arr[i]=(arr[i]+5)%10;
        }
        for (int i = 0; i < 3; i++) {
            int temp =arr[i];
            arr[i]=arr[6-i-1];
            arr[6-i-1]=temp;
        }
        for (int i = 0; i < 6; i++) {
            System.out.println(arr[i]);
        }
    }
}
